//package com.pengzy.core.gateway_security;
//
//import com.pengzy.comment.web.result.JsonResult;
//import com.pengzy.comment.web.webFluxUtils.ResponseResult;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.server.reactive.ServerHttpResponse;
//import org.springframework.security.core.AuthenticationException;
//import org.springframework.security.web.server.ServerAuthenticationEntryPoint;
//import org.springframework.stereotype.Component;
//import org.springframework.web.server.ServerWebExchange;
//import reactor.core.publisher.Mono;
//
///**
// * @author xiaozhi 2023/7/18
// */
//@Component
//public class AuthenticationEntryPointConfig implements ServerAuthenticationEntryPoint {
//    @Override
//    public Mono<Void> commence(ServerWebExchange exchange, AuthenticationException ex) {
//        ServerHttpResponse response = exchange.getResponse();
//        response.setStatusCode(HttpStatus.UNAUTHORIZED);
//        return ResponseResult.writeWith(exchange, JsonResult.error("认证失败"));
//    }
//}
